//引入封装的axios
import request from '../util/request'
//引入url封装的js
import { KEY, API_24H, API_7D, API_GEO_CITY } from './urlAPI';

//未来24小时天气预报请求
export const fetch24HourData = (locationID) => {
    return request.get(API_24H, {
        params: {
            location: locationID,
            key: KEY,
        }
    })
}

//未来7日天气预报请求
export const fetch7DayData = (locationID) => {
    return request.get(API_7D, {
        params: {
            location: locationID,
            key: KEY,
        }
    })
}

//城市搜索请求
export const fetchCityData = (cityName) => {
    return request.get(API_GEO_CITY, {
        params: {
            location: cityName,
            key: KEY,
        }
    })
}


// export {fetch24HourData,fetch7DayData}

// const fetch24HourData = function(){

// }

// function fetch24HourData(){

// }